/*
 * This file is part of Plop Messenger.
 *
 * Plop Messenger is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  Plop Messenger is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Plop Messenger.  If not, see <http://www.gnu.org/licenses/>.
 */
package pm;

public class Message {

	public static final int CLIENT_CONNECTED = 0;
	public static final int CLIENT_EXITED = 1;
	public static final int NICK_CHANGED = 2;
	public static final int PING = 3;
	public static final int PONG = 4;
	public static final int MESSAGE = 20;
	public static final int CRYPTED = 21;

	private String from;
	private String message;
	private String to;
	private int type;
	private String version;

	public Message(String chan, String from, int type) {
		this(chan, from, "", type);
	}

	public Message(String from, String chan, String message) {
		this(chan, from, message, MESSAGE);
	}

	public Message(String chan, String from, String message, int type) {
		this(chan, from, message, type, Constantes.VERSION);
	}

	public Message(String chan, String from, String message, int type,
			String version) {
		this.to = chan;
		this.from = from;
		this.message = message;
		this.type = type;
		this.version = version;
	}

	public String getFrom() {
		return from;
	}

	public String getMessage() {
		return message;
	}

	public String getTo() {
		return to;
	}

	public int getType() {
		return type;
	}

	public String getVersion() {
		return version;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public void setTo(String chan) {
		this.to = chan;
	}

	public void setType(int type) {
		this.type = type;
	}

	public void setVersion(String version) {
		this.version = version;
	}

}
